Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix as.incfreq() warnings, clarify documentation and add tests #66

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stragu
Copy link

@stragu stragu commented Aug 14, 2021

as.incfreq() would throw a warning when the presence-absence data was only 0s or only 1s.

For example, try the following in the current release:

test_df0 <- data.frame(col1 = rep.int(0, 10))
library(iNEXT)
as.incfreq(test_df0)

This PR fixes the following:

  • Make it so warning is not shown when only either 1 or 0 is present
  • Clarify warnings and documentation
  • Use warning() instead of warnings() for the vector warning (assumed to be a typo)
  • Add tests for as.infreq()

I am not particularly familiar with the package, so wanted to also ask:

  • Is the current behaviour for NAs correct? (As in, keeps the NA, and returns NAs as row sums)
  • What should happen if there are negative values in the matrix or dataframe? Currently, they are not convert to 1s in line 374.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant